UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zs8vazxpsEwML+cC5quXd02eryGK7EpZzKAadlSSt1g='
WHERE
key_id = '4e0f97779ccb160bd46b49f5bd9a3679c09d4c2d4141508b2c55b43f4ac6ce64'
AND (
token = 'zs8vazxpsEwML+cC5quXd02eryGK7EpZzKAadlSSt1g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)