UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '87TZQLBKecIvgmnfxSfWqnxzsjKADX/mgLQVpfAgO7Y='
WHERE
key_id = '0ef37ff9b5cb82b9be6d762589397087c941017b4750fdb9bcc4d2954e08f961'
AND (
token = '87TZQLBKecIvgmnfxSfWqnxzsjKADX/mgLQVpfAgO7Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)