UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bepVf4EoI3ov33ZQ8LYNMMBEJH7g/J8TVoPQYKVMD4s='
WHERE
key_id = 'd021515727abdd549a455ff3f5e953cc3906ddef546e5c481c6b4b75c81251ed'
AND (
token = 'bepVf4EoI3ov33ZQ8LYNMMBEJH7g/J8TVoPQYKVMD4s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)