UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SSz978byOoRFh3Cd5gLQWGMJvqAqaq3ntGiPVi4hntE='
WHERE
key_id = '95d9b1d6e108d186eaedc35a659a3eb4b45c064e1e27a5aaeb3b88aa605bbb4d'
AND (
token = 'SSz978byOoRFh3Cd5gLQWGMJvqAqaq3ntGiPVi4hntE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)