UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kY6akeDWxpocYv1ibwQ/MWhPCh7UQHRr2XGC3g0u5q0='
WHERE
key_id = 'e296a03458795d44872bf6e5545236dc6dc2ed2113e668e50b750af7468649b2'
AND (
token = 'kY6akeDWxpocYv1ibwQ/MWhPCh7UQHRr2XGC3g0u5q0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)