UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+quBH0z8RiuhrzfiYKbeu0pi544LAIQZUdTzOFyoy0I=' 
WHERE 
  key_id = '5cc5891e60c8e2ff6b097e6e26fe1dbe5465661a2514c262918793f975705447' 
  AND (
    token = '+quBH0z8RiuhrzfiYKbeu0pi544LAIQZUdTzOFyoy0I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033