UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3xBk8WrE7nUQzvPHdLk5fHdjIzFD43WN+/Ok08RGwVg='
WHERE
key_id = 'bd27c52302cf0afa4b86765060dbaf2cbc5501487644ced3c08dbd73dab09f77'
AND (
token = '3xBk8WrE7nUQzvPHdLk5fHdjIzFD43WN+/Ok08RGwVg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)