UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QzbxPhSLu1JKTFQoHfOUWvH5A+4oGXw3fuKNl5LHS+A=' 
WHERE 
  key_id = 'e38b4a01acd5cdb73fa29a76090d9b288ced1e654d46f69b97c2bc6342023fbe' 
  AND (
    token = 'QzbxPhSLu1JKTFQoHfOUWvH5A+4oGXw3fuKNl5LHS+A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045