UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xq94L1DBEUSXaB/xxbrv1VXWTK2QiB5NRnq2baOR7Uc='
WHERE
key_id = 'bfb7499dc124506aefc0d9bf94cb5f5032749e651b019135e0d5f1abd83bfff3'
AND (
token = 'xq94L1DBEUSXaB/xxbrv1VXWTK2QiB5NRnq2baOR7Uc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)