UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hSQ/Izon/S61IIAYcZAq2aDvWciQ8nCCyjGNG0GWZg0='
WHERE
key_id = '5daa0fa462ff9dd7438cbe6e1135493e69b6ef803235f9c9d8b182481a870956'
AND (
token = 'hSQ/Izon/S61IIAYcZAq2aDvWciQ8nCCyjGNG0GWZg0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)