UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i8PPlPEhAYRrtcuPfUXJm9RrnyEHMSs//1f+iFGGv+A='
WHERE
key_id = '13b0c443c7a31dcbc05fdc9c4b5b1ecc54a690372c1f10a128e6fa3191d620b2'
AND (
token = 'i8PPlPEhAYRrtcuPfUXJm9RrnyEHMSs//1f+iFGGv+A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)