UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aFerwmO/fhb0/WaeFfBA+8Yz/996D+6KeEQK8uo5Lzg=' 
WHERE 
  key_id = '99d2f11304dde1a611078cfaefd90ce17172809671b3dfa98a3bbe0c3338f0ba' 
  AND (
    token = 'aFerwmO/fhb0/WaeFfBA+8Yz/996D+6KeEQK8uo5Lzg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033