UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bNKTwYc8X4kSr8w1cIzSvuQwgIIX/9tBUn6OLxnn37g='
WHERE
key_id = '262145d49fe864b22c7917abe4d3a739dad5f7ee66b34ad888798246d969b91e'
AND (
token = 'bNKTwYc8X4kSr8w1cIzSvuQwgIIX/9tBUn6OLxnn37g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)