UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hWR+ctjjEbd96pTEY8hw5xmYPJbFUdjEKMT5XoHBZeo='
WHERE
key_id = '986c5bbc23cb51c0e9ef20bc5a6ab30a46d3751604b5d9d4c1dc73d140bbb533'
AND (
token = 'hWR+ctjjEbd96pTEY8hw5xmYPJbFUdjEKMT5XoHBZeo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)