UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'seAtvyH+RseHXQn/W9QJFon6SR3J8f4Gzkgya9aJNhQ='
WHERE
key_id = '95583c282ce9d3b7370adf781e4e6949653d926f385b6cdb2ce4d96c07a5fa0c'
AND (
token = 'seAtvyH+RseHXQn/W9QJFon6SR3J8f4Gzkgya9aJNhQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)