UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '56lJtgZlDUnDA3SKGXjSuvEhPrr7BQ6t7AExPGseFyw=' 
WHERE 
  key_id = '98377513b28e2392108ba59f25cf20406eb6c688b5449d9d2b51a54ecc5adb26' 
  AND (
    token = '56lJtgZlDUnDA3SKGXjSuvEhPrr7BQ6t7AExPGseFyw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023