UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+KowthamLhi3nJZQMbP/vfY9VbyBIxSc1j+Es6F/eKM='
WHERE
key_id = '8ff3b487a208e880e8931e99e924ad2b4f7301247a253323c820dc2f3a5113b0'
AND (
token = '+KowthamLhi3nJZQMbP/vfY9VbyBIxSc1j+Es6F/eKM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)