UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mSBl+vLeCHqPHRDrlmt/f6YbLzvYVpLndwfM2Pz5VD8=' 
WHERE 
  key_id = '3b8421219766ca6677b5c060c43ce3c5fa6f8cd91694f598b3193f2e80837fb9' 
  AND (
    token = 'mSBl+vLeCHqPHRDrlmt/f6YbLzvYVpLndwfM2Pz5VD8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027