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