UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n7wi5lyqah035FEgWAHedlVSwysgkVfUYwK3Uqslu/8='
WHERE
key_id = 'f163fce23e6653d8ebd50727eb8239945ee7d6f7ee0c1db73462eef2f22b07db'
AND (
token = 'n7wi5lyqah035FEgWAHedlVSwysgkVfUYwK3Uqslu/8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)