UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5CqqEIGvQEDivrbfeuYzlzUBxlybd4fc5U4Tu2kVB2Q='
WHERE
key_id = '92e3cb73a05b896338bc9ceace6ff521150caf6d378485eea717a3d53aae87dc'
AND (
token = '5CqqEIGvQEDivrbfeuYzlzUBxlybd4fc5U4Tu2kVB2Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)