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