UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZXM6+wv6FL0YDm8pwGU2MmkhtfoCkz1bCyBz0iBbnpk='
WHERE
key_id = '58b2ddf3a884a17c5c937c214a82cf1f763801f098080bf1080fadcb200cbeab'
AND (
token = 'ZXM6+wv6FL0YDm8pwGU2MmkhtfoCkz1bCyBz0iBbnpk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)