UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u0aB/8zmCaDJGVYhTvNWr0iFi7WSUsFanCOkYwJMONc='
WHERE
key_id = 'ee1ac40c1d73732fbfed9e04cec1ac12cc90d34deccb5b0d0c7e8d0522a6ebaa'
AND (
token = 'u0aB/8zmCaDJGVYhTvNWr0iFi7WSUsFanCOkYwJMONc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)