UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JclWiRnG7aJZWRGfDWQVvbrnVpbIXc1dN0IxHZDFmCU='
WHERE
key_id = 'b3db170cc1a9c81e3f98c60b38581c06d6193f1817fa1581c618d6d5267c1c26'
AND (
token = 'JclWiRnG7aJZWRGfDWQVvbrnVpbIXc1dN0IxHZDFmCU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)