UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't95+UPi7OMeUaP/scuWHs6jXsnGSsSEloWj8DlI0pZc='
WHERE
key_id = 'a2968c03e0123351c53c52d4f9e438764bcf365b01ed4dd6e8cecff2928eff5c'
AND (
token = 't95+UPi7OMeUaP/scuWHs6jXsnGSsSEloWj8DlI0pZc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)