UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6G4kSyzMLeiUnmfktdN5wzKZRnx5S3RLroIrZSklIhg=' 
WHERE 
  key_id = 'f4a1534304252b5646f8e8a0141e68d8cd03dd0268313f6f94062888b3a0ab4b' 
  AND (
    token = '6G4kSyzMLeiUnmfktdN5wzKZRnx5S3RLroIrZSklIhg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021