UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JMusMwB49NotRbQ4aRMp8imbJVEIlCs+f0QDyB9YQUs='
WHERE
key_id = '14d323475390fd267e3d9062dec9619b1829daacff494fb0ec8a73e6bf1a19ce'
AND (
token = 'JMusMwB49NotRbQ4aRMp8imbJVEIlCs+f0QDyB9YQUs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)