UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rXKjHqauzPB2CtFsh4lknJzpeohyJymItzHIMX4ycso='
WHERE
key_id = '4911b4e34381fb1919d3780ead8a5965ec14315722fe5da95daef88bc92c9097'
AND (
token = 'rXKjHqauzPB2CtFsh4lknJzpeohyJymItzHIMX4ycso='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)