UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tnLL7v2jjNwqwiHe55gxkMoPxC9EZabkzrFsyPosgTk='
WHERE
key_id = '70320eacf045ca6545113140abb26809dbd1cdeadd9594d41c3b601281e9652a'
AND (
token = 'tnLL7v2jjNwqwiHe55gxkMoPxC9EZabkzrFsyPosgTk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)