UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'px/U8/42c7FeB3FU0dE96rr5BIDI4yscVYklLn43bEk='
WHERE
key_id = 'b4fb5f7c4263b682fa10e93a45533e8a575eae2a2fb2944efa3cb73f9ca715d3'
AND (
token = 'px/U8/42c7FeB3FU0dE96rr5BIDI4yscVYklLn43bEk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)