UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0nrRkUTDqDjHc5jBWnGWi0PkCdJn776AJf6wkfflbas=' 
WHERE 
  key_id = 'c086583bd19bd125197886b0f746b3e63d16fdd7ed6cae20b1a4939e056c5f48' 
  AND (
    token = '0nrRkUTDqDjHc5jBWnGWi0PkCdJn776AJf6wkfflbas=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00071