UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fNtxeIBTPSJm66UgiycQoS9D605jC+jjqgF3gzpeZ3k='
WHERE
key_id = '46867cdfe1367180f94372fe9f95a34f2a2d5bee9ae3795dcd447328c24d62b4'
AND (
token = 'fNtxeIBTPSJm66UgiycQoS9D605jC+jjqgF3gzpeZ3k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)