UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DFQ4lHuxQDEcYqHj9hmiZwKgr8WlbyIc5+1oxHLhR/Q=' 
WHERE 
  key_id = '86ae879ef8b6d239c24eb226f9a02e9be42beb9f68a9d5a5f3ecd765cae00197' 
  AND (
    token = 'DFQ4lHuxQDEcYqHj9hmiZwKgr8WlbyIc5+1oxHLhR/Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035