UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qf+CYvNqtcjVhYt5y5mzJIcm7/nXUU6mcjt32Q3czsk='
WHERE
key_id = '9bfd42524d2936c145b02256f5aa1af2233c7a05a1d4f605d78bfa1775142d5c'
AND (
token = 'Qf+CYvNqtcjVhYt5y5mzJIcm7/nXUU6mcjt32Q3czsk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)