UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BB/zcNw4nlLScf7OeeIZ76XIh/J2Y+TF9XnS458k0UM=' 
WHERE 
  key_id = '208ecfbd4e6ce188115f4af1507f368fc09da2ee8a3e13dcde4b411aa5eb30a4' 
  AND (
    token = 'BB/zcNw4nlLScf7OeeIZ76XIh/J2Y+TF9XnS458k0UM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033