UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '65kiLWI+mC9MiPJmHapSQ39YcNKLPV0b8QbeQWrg7Wo=' 
WHERE 
  key_id = '78c4c7099f3d6fefe8cd3cc9cd84aabb666b5b83bd5d6a369cc6f791e3c2991e' 
  AND (
    token = '65kiLWI+mC9MiPJmHapSQ39YcNKLPV0b8QbeQWrg7Wo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031