UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7MuWy4Qq1nEezmtsL7wrm7ZLZ5M2+WaCJVOj9re2L8g='
WHERE
key_id = '9bcb3c412d063f1a8fa2ab0a94f9d2cab043d1e1bf2890dbc56c1f18442e5190'
AND (
token = '7MuWy4Qq1nEezmtsL7wrm7ZLZ5M2+WaCJVOj9re2L8g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)