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