UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VjivyJSDOE0KSXl7b1/Gox+ApSlJpH2PpepuHOh1qWI='
WHERE
key_id = '45e15bbe865f530f481626c1282998f1dbe69a18396aecb3fd1964646473539b'
AND (
token = 'VjivyJSDOE0KSXl7b1/Gox+ApSlJpH2PpepuHOh1qWI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)