UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BiNiFioYCu25OW7TR8Citcmgxa67ycpTuTl216XY/WY='
WHERE
key_id = '03f3c287e62582d831d2e3bf31e0f7a1834d3b6bce4dc731012e8b15764fe376'
AND (
token = 'BiNiFioYCu25OW7TR8Citcmgxa67ycpTuTl216XY/WY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)