UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vANVxs6+gkEg9nRzRe+QvGL5bXR0EQsVVOD60pFLy9A='
WHERE
key_id = '5352fd1752618e2bf201a6d350bc54e0054444cb934b2902529aee1eb12149af'
AND (
token = 'vANVxs6+gkEg9nRzRe+QvGL5bXR0EQsVVOD60pFLy9A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)