UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JUPvtnQ5CfHRX65dcN3A09A+tbqpukgpRqGY0lu/uGY=' 
WHERE 
  key_id = 'cd8ca1ac27f435b2d4e8dbd4eeca80ccf40ad7b770356adf51bedb980651e83a' 
  AND (
    token = 'JUPvtnQ5CfHRX65dcN3A09A+tbqpukgpRqGY0lu/uGY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035