UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'N8020LMddjc9WwMZN1xcSZjwZq7qSHBp+x2bZ7M+8pY=' 
WHERE 
  key_id = '46980be22b41b43d215730c6d1e6d0309468def2fad5e71e810bfadee609ce71' 
  AND (
    token = 'N8020LMddjc9WwMZN1xcSZjwZq7qSHBp+x2bZ7M+8pY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037