UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dRh5SjLaxNG7IiK5OEOdPdyM6woY3tkvQLZ3uL5c6c4=' 
WHERE 
  key_id = '4e754a159083eb2c4d28ba85829292675a649cd1ef60abafb21306592b0036a8' 
  AND (
    token = 'dRh5SjLaxNG7IiK5OEOdPdyM6woY3tkvQLZ3uL5c6c4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027