UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4XDkcitPshZmf6IvlbCF3zXOWC+DvJoobCRspZRPey8='
WHERE
key_id = '7c97409b93edc516081b36bb1b40fcd247ec9eb4a25e7da44bb7d1c8cc1554ac'
AND (
token = '4XDkcitPshZmf6IvlbCF3zXOWC+DvJoobCRspZRPey8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)