UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'phJ/3TLyoppL5imfOzQWWFaXpaFNK/RkEgId1GS16V8='
WHERE
key_id = '65569e7ca274e359b619bf4c98e6bb63eda4450c0bfc39df5768f80f3ca9b91b'
AND (
token = 'phJ/3TLyoppL5imfOzQWWFaXpaFNK/RkEgId1GS16V8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)