UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7ZlICj6tp3+V5iI7PWzOnrxiiHwdyQMP+MC4RCEHjsc=' 
WHERE 
  key_id = '98c3eda60d0372a5222dd677736c01a74d24529a037a47464a29e777fffa1573' 
  AND (
    token = '7ZlICj6tp3+V5iI7PWzOnrxiiHwdyQMP+MC4RCEHjsc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021